package com.neusoft.mapper;

import com.neusoft.entity.Disease;
import com.neusoft.entity.MedicalRecordDisease;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author akemihomurasama
 */
@Mapper
public interface MedicalRecordDiseaseMapper {
    /**
     * 根据患者id插入关联的疾病id
     *
     * @param diseaseList     疾病列表
     * @param medicalRecordId 患者病历首页id
     */
    void addDiseaseForPatient(@Param("diseaseList") List<Disease> diseaseList, @Param("medicalRecordId") int medicalRecordId);

    /**
     * 根据病历首页id查询疾病id列表
     *
     * @param recordId 病历首页id
     * @return 疾病id列表
     */
    List<Integer> queryDiseaseIdListByRecordId(int recordId);

    /**
     * 根据疾病id列表和患者病历首页id批量删除患者疾病
     *
     * @param diseaseIdList 疾病id列表
     * @param recordId      患者病历首页id
     */
    void deleteDiseaseByRecordIdDiseaseId(@Param("diseaseIdList") List<Integer> diseaseIdList
            , @Param("recordId") int recordId);
}
